package com.nanshututeng.config;


import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created by 黄启位 on 2018-09-07.
 */
public class DynamicDataSource extends AbstractRoutingDataSource{
    @Override
    protected Object determineCurrentLookupKey() {
        System.out.println("数据源为"+DataSourceContextHolder.getDB());
        return DataSourceContextHolder.getDB();
    }
}
